package main

import (
	"fmt"
	"time"
)

func newTask() {
	for {
		fmt.Println("this is a newTast")
		time.Sleep(time.Second) // 延时1s
	}
}

// 主函数可以理解为主协程
func main() {
	go newTask() //新建一个协程
	for {
		fmt.Println("this is main goroutine")
		time.Sleep(time.Second)
	}

}
